package com.jht.mymvvm.activity.homepage

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.jht.mymvvm.App
import com.jht.mymvvm.db.AppDatabase
import com.jht.mymvvm.db.entity.User

class DB {
    companion object {
        fun findAllUsers(name:String): MutableLiveData<List<User>> {
            val userDao = AppDatabase.getDatabase(App.ctx).userDao()
            val loadAllUsers = userDao.loadAllUsersByName(name)
            return MutableLiveData(loadAllUsers)
        }
    }


}